--[[
    服务器相关配置
--]]

local server_name = g.getenv("server_name")
local src_path = g.getenv("root") --server所在目录
local server_path = g.getenv("base_root") --server所在目录
local res_path = server_path .. "/res" --res所在目录




local Config = {}

--写日志到目录
Config.log_path = "/home/logs/"
--日记级别
Config.log_level = "info" --debug, info, waring, error, fatal

--配置文件目录
Config.config_path = src_path.."/config" --"/data/config"
--.pb文件所在目录
Config.pb_path = server_path.."res/pb"
Config.proto = {
    type = "sproto",
    c2s = res_path.."/sproto/c2s.sproto",
    s2c = res_path.."/sproto/s2c.sproto",
}

--redis相关配置
Config.redis = {
    host = "127.0.0.1",
    port = 6379,
    password = "game_redis_sevenflower",
    db_id = 0,
}
--mysql配置
Config.mysql = {
    host = "192.168.2.122",
    port = 3306,
    database = "lj_poker",
    user = "root",
    password = "12345",
}
Config.mysql_logs = {
    host = "192.168.2.122",
    port = 3306,
    database = "lj_poker_logs",
    user = "root",
    password = "12345",
}

Config.rabbit = {
    {host = "192.168.2.36", port = 61613},
    {username = "guest", password = "111111", vhost = "sflower"},
    {name = "/exchange/test",  key="test"},
}

--mongo配置
Config.mongo = {
    host = "127.0.0.1",
    port = 27017,
    database = "test",
    user = nil,
    password = nil,
}
--web后台
Config.web = {
    gm = "http://192.168.2.35",
    rlcard = "http://127.0.0.1:6060" --http://192.168.2.36:8080
}

--节点配置
local node_info = {
    --与后通信的web节点
    ndadmin = {
        id = 1,
        name = "ndadmin",
        type = "ndweb",
        nodeip = "127.0.0.1",
        nodeport = 60010, --集群端口
        debug_port = 60011, --控制台端口
        client_port = 60012,
        enable = true, --可用
        maxclient = 1000,
    },
    --游戏节点
    ndtexas = {
        id = 2,
        name = "ndtexas", --节点名
        type = "ndgame", --节点类型
        nodeip = "127.0.0.1",
        nodeport = 60020, --集群端口
        debug_port = 60021, --节点控制台
        client_port = 60022, --客户端连接的端口
        enable = true, --可用
        maxclient = 1000, --最大人数
        game_type = 0, --游戏类型
    },
    ndmatch = {
        id = 21,
        name = "ndmatch",
        type = "ndgame",
        nodeip = "127.0.0.1",
        nodeport = 60023,
        debug_port = 60024,
        --client_port = 60025,
        enable = true, --可用
        maxclient = 1000,
        is_match = true, --是比赛场节点
        game_type = 0, --游戏类型
    },
    --游戏节点
    ndbilliard = {
        id = 22,
        name = "ndbilliard",
        type = "ndgame",
        nodeip = "127.0.0.1",
        nodeport = 60025, --集群端口
        debug_port = 60026, --节点控制台
        client_port = 60027, --客户端连接的端口
        enable = true, --可用
        maxclient = 1000, --最大人数
        game_type = 1, --游戏类型
    },
    --流水日志节点
    ndlogs = {
        id = 3,
        name = "ndlogs",
        type = "ndlogs",
        nodeip = "127.0.0.1",
        nodeport = 60030,
        debug_port = 60031,
        enable = true, --可用
        maxclient = 1000,
    },
    ndbot = {
        id = 4,
        name = "ndbot",
        type = "ndbot",
        nodeip = "127.0.0.1",
        nodeport = 60040,
        debug_port = 60041,
        enable = true, --可用
        maxclient = 1000,
    },

    ndtest = {
        id = 7,
        name = "ndtest",
        type = "ndtest",
        nodeip = "127.0.0.1",
        nodeport = 60100,
        debug_port = 60101,
        enable = false, --可用
    },
}
Config.server_info = node_info[server_name]
Config.env = "local" --环境 local本地 test测试 pro正式

return Config